<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
    <div>
        <div>
            <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1585627656987&di=34fb9d4331bb91cbce77706b97802834&imgtype=0&src=http%3A%2F%2Fbpic.588ku.com%2Fback_pic%2F04%2F86%2F46%2F1658e63b9ee4e7c.jpg"/>
        </div>
        <!-- 登录 -->
       <div id="content"></div>
    </div>
   
</body>
<script>
    
    let contentDom = document.getElementById('content')

    let lDom =(btnTxt,tiptxt,funcname)=>{
        //不建议直接拼接字符串 感兴趣的同学可以搜索handlebars
        return '<div id="login_out">'+
                    '<h2>欢迎来到潜力无限科技有限公司</h2>'+
                    '<h2>'+btnTxt+'页</h2>'+
                    '<input type="text" />'+
                    '<input type="password" />'+
                    '<button>'+btnTxt+'</button>'+
                    '<p onclick="'+funcname+'()" >'+tiptxt+'</p>'+
                '</div>'
    } 

    let regiseterDom = ()=> contentDom.innerHTML = lDom('登录','没有账号去注册','loginDom')
    let loginDom = () => contentDom.innerHTML =lDom('注册','已有账号去登录','regiseterDom')
    
    contentDom.innerHTML = lDom('登录','没有账号去注册','loginDom')
   
</script>
</html>